Skip to content

[python] Add unified Blob.from_bytes resolver#7891

Draft
XiaoHongbo-Hope wants to merge 5 commits into
apache:masterfrom
XiaoHongbo-Hope:inline_blob
Draft

[python] Add unified Blob.from_bytes resolver#7891
XiaoHongbo-Hope wants to merge 5 commits into
apache:masterfrom
XiaoHongbo-Hope:inline_blob

Conversation

@XiaoHongbo-Hope
Copy link
Copy Markdown
Contributor

Purpose

Tests

Revert the read-path changes from 4cf7b23 that always resolved blob
descriptors to data. Restore master behavior where blob-as-descriptor
flag is respected. Add Blob.from_bytes(data, file_io) as a unified
entry point (equivalent to Java's Blob.fromBytes) that auto-dispatches
BlobData vs BlobRef based on the bytes content.
- Add Optional[bytes] type annotation for data parameter
- Raise ValueError when file_io is None but bytes are BlobDescriptor
- Add unit tests for from_bytes covering all branches
@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as ready for review May 19, 2026 09:45
@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as draft May 19, 2026 10:00
- from_bytes(None) returns None (not empty BlobData), matching Java
- Add allow_blob_data parameter (Java's 4th arg): when False, always
  interpret bytes as descriptor
- Integrate into read path: _blob_cell_to_data now delegates to
  Blob.from_bytes instead of duplicating dispatch logic
@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as ready for review May 19, 2026 14:10
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Support transparent blob resolution on read [python] Add Blob.from_bytes unified API May 19, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Add Blob.from_bytes unified API [python] Add Blob.from_bytes to support interpreting blob bytes as Blob object May 19, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Add Blob.from_bytes to support interpreting blob bytes as Blob object [python] Support unified blob reads May 19, 2026
@XiaoHongbo-Hope XiaoHongbo-Hope marked this pull request as draft May 19, 2026 16:00
@XiaoHongbo-Hope XiaoHongbo-Hope changed the title [python] Support unified blob reads [python] Add unified Blob.from_bytes resolver May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant